home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / vgamaze4.zip / VGA3D.H < prev    next >
C/C++ Source or Header  |  1994-02-14  |  2KB  |  53 lines

  1. #ifndef VGA3D_H
  2. #define VGA3D_H
  3.  
  4. //      Objects instantiated from this class may be used to plot z=f(x,y) in
  5. // in three dimensions on a VGA display.
  6.  
  7. //      This class uses the abstract class "plot3d" (3D plot) which in turn uses 
  8. // the template "varray" (one dimensional virtual array) and the class
  9. // "titillat" (to let the user know the code is running).
  10.  
  11. #include "plot3d.h"
  12.  
  13. typedef char * char_ptr;
  14.  
  15. // screen constants
  16. #define HEIGHT_OF_SCREEN    6.0  
  17. #define WIDTH_OF_SCREEN     8.0  // same units as HEIGHT_OF_SCREEN
  18.  
  19. // graphics constants
  20. #define NUM_X_PIXELS      640
  21. #define NUM_Y_PIXELS      480
  22.  
  23. class vga3d : public plot3d
  24.   {
  25.     private:
  26.       double AspectRatio;
  27.                // (HEIGHT_OF_SCREEN/WIDTH_OF_SCREEN)
  28.                // /(((double) NUM_Y_PIXELS)/((double) NUM_X_PIXELS))
  29.       int    graph_open;
  30.                // TRUE if and only if the display has been initialized.
  31.     public:
  32.       double aspect_ratio(void) {return AspectRatio;}
  33.  
  34.       int    display_initialized(void);
  35.                // Set display to 640x480x16 VGA mode.  Define shades of gray
  36.                // and color for highlighting.
  37.  
  38.       int    num_x_pixels(void) {return NUM_X_PIXELS;}
  39.  
  40.       int    num_y_pixels(void) {return NUM_Y_PIXELS;}
  41.  
  42.       void   pset(int x,int y,int color_num);
  43.                // Set the color of the pixel at (x,y).
  44.  
  45.              vga3d(void);
  46.  
  47.              ~vga3d(void);
  48.  
  49.       int    write_outfile(char *file_name) {return -1;}
  50.   };
  51.  
  52. #endif
  53.